<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
  <meta charset="UTF-8">
  <title>菜单的功能权限模块 - TyFast Platform</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
  <!--/* 功能权限管理代码片段 */-->
  <th:block th:fragment="func">
    <!-- 右侧抽屉窗口 :: 功能权限列表 -->
    <v-navigation-drawer fixed temporary right :stateless="winFormDrawer" :width="winDrawerWidth" v-model="winDrawer">
      <v-sheet>
        <v-app-bar flat absolute dark color="indigo darken-2">
          <v-toolbar-title class="text-subtitle-1 font-weight-bold">{{currentMenuName}} :: {{$t('功能权限')}}{{$t('列表')}}</v-toolbar-title>
          <v-spacer></v-spacer>
          <v-btn icon @click="closeWinDrawer">
            <v-icon>mdi-close</v-icon>
          </v-btn>
        </v-app-bar>
        <v-card flat tile class="pb-13 pt-14">
          <v-container>
            <v-row shiro:hasPermission="/system/menu/func/save">
              <v-col>
                <v-btn depressed color="info" class="pr-5 pl-4" @click="openWinFormDrawer($t('新增')+$t('功能权限'))">
                  <v-icon small>mdi-plus</v-icon>
                  {{$t('新增')}}
                </v-btn>
              </v-col>
            </v-row>

            <!-- 功能权限数据列表 -->
            <v-data-table
                :headers="datatableFunc.headers"
                :items="datatableFunc.items"
                item-key="menuId"
                hide-default-footer
                disable-sort
                disable-pagination
                fixed-header
                :loading="loading"
            >
              <template v-slot:item.operation="{item}">
                <a class="mr-2" @click="openWinFormDrawer($t('修改')+$t('功能权限'), item.menuId)" shiro:hasPermission="/system/menu/func/update">{{$t('修改')}}</a>
                <v-btn-confirm :data="item" @confirm="doDelete" shiro:hasPermission="/system/menu/del"></v-btn-confirm>
              </template>
            </v-data-table>
          </v-container>
        </v-card>
      </v-sheet>
      <v-footer fixed class="border-top justify-end" :color="vdark? null : 'white'">
        <v-btn depressed outlined text class="mr-4" @click="closeWinDrawer" v-t="'关闭'"></v-btn>
      </v-footer>
    </v-navigation-drawer>

    <!-- 右侧抽屉窗口 :: 功能权限表单 -->
    <v-navigation-drawer fixed temporary right stateless :width="winFormDrawerWidth" v-model="winFormDrawer" style="z-index:10">
      <validation-observer ref="funcObserver" v-slot="{handleSubmit}">
        <v-form ref="funcDataForm" @submit.prevent="handleSubmit(doFuncSubmit)">
          <v-sheet>
            <v-app-bar flat absolute dark color="indigo darken-2">
              <v-toolbar-title class="text-subtitle-1 font-weight-bold">{{drawerTitle}}</v-toolbar-title>
              <v-spacer></v-spacer>
              <v-btn icon @click="closeWinFormDrawer">
                <v-icon>mdi-close</v-icon>
              </v-btn>
            </v-app-bar>
            <v-sheet class="pb-13 pt-16">
              <v-container>
                <validation-provider v-slot="{ errors }" name="权限名称" rules="required|max:30">
                  <v-text-field outlined dense clearable type="text" :error-messages="errors" v-model.trim="funcFormData.menuName" :label="$t('权限名称')"></v-text-field>
                </validation-provider>
                <validation-provider v-slot="{ errors }" name="请求地址" rules="required|letter_dash|max:100">
                  <v-text-field outlined dense clearable type="text" :error-messages="errors" v-model.trim="funcFormData.url" :label="$t('请求地址')"></v-text-field>
                </validation-provider>
              </v-container>
            </v-sheet>
          </v-sheet>
          <v-footer fixed class="border-top justify-end" :color="vdark? null : 'white'">
            <v-btn depressed outlined text class="mr-4" @click="closeWinFormDrawer" v-t="'关闭'"></v-btn>
            <v-btn depressed color="info" type="submit" :loading="posting">{{$t('保存')}}</v-btn>
          </v-footer>
        </v-form>
      </validation-observer>
    </v-navigation-drawer>

    <!-- 业务js -->
    <script type="text/javascript" th:src="@{/js/system/menu/menu-func.js?_t=#buildtime#}"></script>
  </th:block>
</body>
</html>